package com.atguigu.gulimall.auth.config;

/**
 * @author ：TJH
 * @date ：Created in 2020/7/19 16:52
 * @description：自定义流控返回数据
 */
/*@Configuration
public class SeckillSetinelConfig {

    public SeckillSetinelConfig() {
        WebCallbackManager.setUrlBlockHandler(new UrlBlockHandler() {
            @Override
            public void blocked(HttpServletRequest request, HttpServletResponse response, BlockException e) throws IOException {
                R error = R.error(BizCodeEnume.TOO_MANY_REQUESTS.getCode(), BizCodeEnume.TOO_MANY_REQUESTS.getMsg());
                response.setCharacterEncoding("UTF-8");
                response.setContentType("application/json");
                response.getWriter().write(JSON.toJSONString(error));
            }
        });
    }
}*/
